<template>
  <div class="home-banner">
    <!-- 使用封装好的轮播图，将获取到的数据传过去 -->
    <XtxCarousel :sliders='imgs' />
  </div>
</template>
<script>
// 引入获取轮播图数据的api
import { findBanner } from '@/api/home.js'
import { ref } from 'vue'
export default {
  name: 'HomeBanner',
  setup () {
    const imgs = ref([])
    findBanner().then(res => {
      imgs.value = res.result
    })
    return { imgs }
  }
}
</script>
<style scoped lang="less">
.home-banner {
  width: 1240px;
  height: 500px;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 98
}
/deep/.carousel-indicator{
    padding-left: 250px;
}
/deep/  .carousel-btn.prev{
    left:270px !important;
}
</style>
